// 当前这个模块：API进行统一管理
// 引入封装的axios
import requests from "./request";
// 引入封装的mockaxios

//获取验证码
export const reqGetCodeImg = () => requests.get("/captchaImage");

//登录
export const reqUserLogin = (data) =>
    requests({ url: "/login", data, method: "post" });

//注册
export const reqUserRegister = (data) =>
    requests({ url: "/register", data, method: "post" });
//获取用户信息【需要带着用户的token向服务器要用户信息】
//URL:/api/user/passport/auth/getUserInfo  method:get
export const reqUserInfo = () =>
    requests({ url: "/getInfo", method: "get" });

//退出登录
export const reqlogout = () => requests({ url: "/logout", method: "post" });

//获取当前城市信息
export const reqCityList = () => requests({ url: "/show/list", method: "get" });

//修改基本信息
export const reqUpdateUserInfo = (user) => requests({ url: "/system/user/profile", data:user ,method: "put" });

//修改密码
export const reqUpdateUserPassowrd = (oldPassword,newPassword) => requests({ url: "/system/user/profile/updatePwd", params:{
        oldPassword: oldPassword,
        newPassword: newPassword
    } ,method: "put" });


//获取排行前几的空气质量信息排行
export const reqshowAirLimit = () => requests({ url: "/show/max/page", method: "get" });


//获取当前所有城市空气质量信息排行
export const reqshowAir = () => requests({ url: "/show/max", method: "get" });


//根据id获取城市详细空气信息
export const reqIdCityInfo = (id) => requests({ url: `/show/city/${id}`, method: "get" });

//根据获取城市id
export const reqCityId = (name) => requests({ url: `/show/city/name/${name}`, method: "get" });


//提交举报信息
export const reqNeuTask = (neuTask) => requests({ url: `/system/task`, data:neuTask, method: "post" });

//获取当前用户举报信息
export const reqTankHistory = () => requests({ url: `/system/task`, method: "get" });

//根据id获取任务追踪
export const reqIdTack = (id) => requests({ url: `/system/task/getone/${id}`, method: "get" });